package com.guijq.design.command.simpleremote;

/**
 * @author yangjf
 * @version 0.1.0
 * @time 2018/10/23/023
 */
public class RemoteControlTest {
    public static void main(String[] args) {
        SimpleRemoteControl remote = new SimpleRemoteControl();
        Light light = new Light();
        LightOnCommand lightOn = new LightOnCommand(light);
        remote.setCommand(lightOn);
        remote.buttonWasPressed();

        GarageDoor garageDoor = new GarageDoor();
        GarageDoorOpenCommand doorOpenCommand = new GarageDoorOpenCommand(garageDoor);
        remote.setCommand(doorOpenCommand);
        remote.buttonWasPressed();

    }
}
